home *** CD-ROM | disk | FTP | other *** search
- Path: access1.digex.net!not-for-mail
- From: ell@access1.digex.net (Ell)
- Newsgroups: comp.lang.c++
- Subject: Re: Constructor classes
- Date: 24 Feb 1996 01:49:30 GMT
- Organization: The Universe
- Message-ID: <4glqra$c6p@news4.digex.net>
- References: <4gi8es$4gn@daily-planet.execpc.com> <312CC9CA.473F@wpo.borland.com>
- NNTP-Posting-Host: access1.digex.net
- X-Newsreader: TIN [UNIX 1.3 950824BETA PL0]
-
- : Sherri Scalish wrote:
- : >
- : > Hope someone can help me, I'm getting very frustrated. I have a container
- : > class in which I have an array of classes:
- : >
- : > class OtherClass{
- : > private:
- : > char m_itema[30];
- : > char m_itemb[30];
- : > ...
- : > }:
- : >
- : > class ContainerClass{
- : > public:
- : > OtherClass Items[9];
- : > ...
- : > };
- : >
- : >
- : > How do I access the array's data members? I have tried:
- : > m_itema[0], ContainerClass->m_itema[0], ContainerClass.m_itema[0],
- : > OtherClass->m_itema[0]. OtherClass.m_itema[0], etc. etc.
-
- You can not access the private members of another class, unless you are a
- friend.
-
- Elliott
-